import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
import First from '../routerLink/sub/First.vue'
import Second from '../routerLink/sub/Second.vue'
import Third from '../routerLink/sub/Third.vue'
import Forth from '../routerLink/sub/Forth.vue'
import Home from '../routerLink/Home.vue'
import Login from '../routerLink/Login.vue'
import FirstPage from '../routerLink/FirstPage.vue'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'Home',
        component: Home,
        children: [{
                path: '/',
                name: 'First',
                component: First
            },
            {
                path: '/second',
                name: 'Second',
                component: Second
            },
            {
                path: '/third/:ids',
                name: 'Third',
                component: Third
            },
            {
                path: '/forth/:age',
                name: 'Forth',
                component: Forth
            }
        ]
    },
    {
        path: '/login',
        name: '登录页',
        component: Login
    },
    {
        path: '/firstPage',
        name: '首页',
        component: FirstPage
            // {
            //     path: '/about',
            //     name: 'About',
            //     // route level code-splitting
            //     // this generates a separate chunk (about.[hash].js) for this route
            //     // which is lazy-loaded when the route is visited.
            //     component: () =>
            //         import ( /* webpackChunkName: "about" */ '../views/About.vue')
            // }
    }
]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

export default router